package com.demo.service.impl;


import com.demo.dao.ModVODao;
import com.demo.service.ModVOService;
import com.demo.vo.Module;
import com.demo.vo.ModVOSeacherInfo;
import com.demo.vo.Pro;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ModVOServiceImpl implements ModVOService {

    @Autowired
    ModVODao modVODao;

//    @Override
    public List<Module> getModList(ModVOSeacherInfo info){
        return modVODao.getModList((info.getPage()-1)*info.getLimit(),
                info.getLimit(),info.getModId(),info.getModName(),info.getPrjId());
    }


//    @Override
    public int getModCount(ModVOSeacherInfo info) {
        return modVODao.getModCount(info);
    }

    @Override
    public int addMod(Module module){
        return modVODao.addMod(module);
    }

    @Override
    public List<Pro> getAllProjectList(){
        return modVODao.getAllProjectList();
    }

    @Override
    public int deleteMod(String modId){
        return modVODao.deleteMod(modId);
    }

    @Override
    public int updateMod(Module module){
        return modVODao.updateMod(module);
    }
}
